package com.example.miaopin.adapter;

import com.example.miaopin.fragment.FragmentFactory;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class ContentAdapter extends FragmentPagerAdapter {
	private String[] CONTENT;

	public ContentAdapter(FragmentManager fm, String[] CONTENT) {
		super(fm);
		this.CONTENT = CONTENT;
	}

	@Override
	public CharSequence getPageTitle(int position) {
		return CONTENT[position % CONTENT.length].toUpperCase();
	}

	@Override
	public int getCount() {
		return CONTENT.length;
	}

	@Override
	public Fragment getItem(int position) {
		return FragmentFactory.createFragment(position);
	}
}